import request from '@/utils/request'

export default {
  // 1.添加课程基本信息
  addCourseInfo(courseInfo) {
    return request({
      url: `/eduservice/course/addCourseInfo`,
      method: 'post',
      data: courseInfo
    })
  },
  // 2.查询所有讲师
  getListTeacher() {
    return request({
      url: `/eduservice/teacher/findAll`,
      method: 'get'
    })
  },
  // 3.根据课程id获取课程基本信息
  getCourseInfoId(id) {
    return request({
      url: `/eduservice/course/getCourseInfo/` + id,
      method: 'get'
    })
  },
  // 4.修改课程基本信息
  updateCourseInfo(courseInfo) {
    return request({
      url: `/eduservice/course/updateCourseInfo`,
      method: 'post',
      data: courseInfo
    })
  },
  // 5.根据课程id查询课程具体信息
  getPublishCourseInfo(courseId) {
    return request({
      url: `/eduservice/course/getPublishCourseInfo/` + courseId,
      method: 'get'
    })
  },
  // 6.课程最终发布(将课程的发布状态改为"已发布")
  publishCourse(courseId) {
    return request({
      url: `/eduservice/course/publishCourse/` + courseId,
      method: 'post'
    })
  },
  // 查询所有的课程
  getListCourse(current, limit, courseQuery) {
    return request({
      url: `/eduservice/course/getAllCourse/${current}/${limit}`,
      method: 'post',
      data: courseQuery
    })
  },
  // 8.根据课程id删除课程
  deleteCourseById(courseId) {
    return request({
      url: `/eduservice/course/` + courseId,
      method: 'delete'
    })
  }
}
